<?php
	
	class model_index extends Application{
		function __construct(){
			//load basic for model
		}
		function login($username, $password){
            $rows = return_array("SELECT password FROM dos_model_usernames WHERE username = '$username' AND enable = 1");
        	if(count($rows) > 0){
        		if (phpbb_check_hash($password, $rows['password'])){
        			return true;
        		}else{
        			return false;
        		}
        	}else{
        		return false;
        	}
        	return false;
		}
        function menu_index(){
			echo '<h1 class="ico">Danh mục điều khiển</h1><ul class="menu">';
			echo '<li><a href="'.PATH.'/index/joblist">Công việc cần xử lý</a></li>';
            echo '<li><a href="'.PATH.'/index/incomplete">Công việc chưa xử lý</a></li>';
            echo '<li><a href="'.PATH.'/index/processing">Công việc đang xử lý</a></li>';
            echo '<li><a href="'.PATH.'/index/completed">Công việc đã hoàn tất</a></li>';
			echo '</ul>';
		}
        function joblist($user){
            return return_array_multi("SELECT job_id, job_title, create_date, status, dos_model_usernames_username FROM dos_model_jobs WHERE username = '$user' AND enable = 1");
        }
        function jobListtype($user, $type){
            return return_array_multi("SELECT job_id, job_title, create_date, status, dos_model_usernames_username FROM dos_model_jobs WHERE username = '$user' AND status = '$type' AND enable = 1");
        }
	}
	
?>